<%@ page import="desmontec.aluguel.*" %>
<modalbox:modalIncludes />
<div class="dialog">
	<table cellpadding="2" cellspacing="1" class="tabelaAzul">
		<thead>
			<tr>
				<th class="cabecalhoTabela" width="46%"><g:message code="Consumo do Dia" /></th>
				<th class="cabecalhoTabela" width="4%"></th>
				<th class="cabecalhoTabela" width="46%"><g:message code="Consumo do Dia" /></th>
				<th class="cabecalhoTabela" width="4%"></th>
			</tr>
		</thead>
		<tbody>
				<g:if test="${consumoDias.size >= 2}">
										
					<g:each in="${consumoDias}" status="i" var="diaAtual">
						<g:if test="${i % 2 == 0}">
							<tr>
						</g:if>
							<g:if test="${j == 1}">
								<td>
								
							</g:if>
							<g:else>
								<td class="linhaAzulClara">
								
							</g:else>
							<modalbox:createLink action="exibirConsumo" 
									id="${diaAtual.id}" 
									title="Consumo" width="400">
                            		${diaAtual?.toString()?.encodeAsHTML()}
							</modalbox:createLink>
							
							
							</td>
							
							<!--  aqui vai ficar o botao de excluir -->
							<g:if test="${j == 1}">
								<td>
								<% j = 0; %>
							</g:if>
							<g:else>
								<td class="linhaAzulClara">
								<% j = 1; %>
							</g:else>
							
								<g:link class="linkDelete" action="removerConsumo" id="${diaAtual?.id}">									
								</g:link>
							
							
							</td>
							<!--  aqui vai ficar o botao de excluir -->
							
						<g:if test="${ i % 2 != 0}">
							<% j++; %>
							</tr>
						</g:if>
					
					</g:each>	
				
				</g:if>
				<g:else>
					
					<g:each in="${consumoDias}" status="i" var="diaAtual">					
						
						<tr >
					
						<td>
							<modalbox:createLink action="exibirConsumo" 
									id="${diaAtual.id}" 
									title="Consumo" width="400">
                            		${diaAtual?.toString()?.encodeAsHTML()}
							</modalbox:createLink>
							
						</td>	
						<td>
							<g:link class="linkDelete" action="removerConsumo" id="${diaAtual?.id}">									
							</g:link>
						</td>					   
						</tr>
					</g:each>	
				</g:else>
		</tbody>
	</table>
</div>